home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / lantutor.zip / LANTUT5.TXT < prev   
Text File  |  1993-01-04  |  12KB  |  246 lines

  1. PART 5: LAN Interface Cards
  2.  
  3. Definition
  4. The network interface card (NIC) is the piece of hardware that
  5. fits inside your computer to provide the physical connection to
  6. the network. Every computer attached to a LAN uses one sort of
  7. network interface card or another. In most cases, the card fits
  8. directly into the expansion bus of the computer. In some cases,
  9. the card will be part of a separate unit to which the computer
  10. attaches through a serial or parallel connection.
  11.  
  12. The interface card takes data from your PC, puts it into the
  13. appropriate format and sends it over the cable to another LAN
  14. interface card. This card receives the data, puts it into a form
  15. the PC understands and sends it to the PC. Simple, right?
  16.  
  17. Wrong. To get one byte of data from here to there hundreds of
  18. things must happen. Buffers must be checked. Requests must be
  19. acknowledged. Sessions must be established. Tokens must be sent.
  20. Collisions must be detected. The list can seem endless.
  21.  
  22. Luckily, the work of the interface card can be broken down into
  23. eight tasks: host-card communications; buffering; packet
  24. formation; parallel-serial conversion; encoding/decoding; cable
  25. access; handshaking and transmission/reception. These are the
  26. steps taken to get data from the memory of one computer to the
  27. memory of another computer.
  28.  
  29. Preparing for Transmission
  30. PC-NIC Communications. There are three ways to move data from the
  31. PC's memory to the network card and back again: DMA, I/O mapping
  32. and shared memory.
  33.  
  34. Shared memory is just that. Part of host memory is shared by the
  35. network interface card's processor. This is a very fast method of
  36. transfer, since no buffering on the card is required. Both the
  37. card and the PC do their work on the data in the same place, so
  38. no transfer is necessary.
  39.  
  40. DMA is short for Direct Memory Access. All Intel-based computers
  41. come with something called a DMA controller. It takes care of the
  42. transfer of data from an input/output device to the PC's main
  43. memory so the PC's main microprocessor, or CPU, does not have to.
  44. For DMA transfer, the controller or processor on the interface
  45. card sends a signal to the CPU indicating it needs DMA. The CPU
  46. then relinquishes control of the PC bus to the DMA controller.
  47. (The bus is the piece of the computer that connects other parts,
  48. e.g. memory and processor).
  49.  
  50. Once the DMA controller has command of the bus, it begins to take
  51. the data from the card and place it directly in memory. It can do
  52. this because it has been informed by the CPU of the appropriate
  53. memory address at which to begin putting data in memory. After
  54. all the data is in memory, the DMA controller returns control of
  55. the bus to the CPU and tells it how much data has been put in
  56. memory. Of course, the whole process takes fractions of a second.
  57.  
  58. There are two types of I/O transfers depending on the PC and
  59. peripheral. The two most important are memory-mapped I/O and
  60. program I/O. In a memory-mapped I/O transfer, the host CPU
  61. assigns some of its memory space to the I/O device, in this case
  62. the network interface card. So out of the possible 640K bytes
  63. available, some amount, say 12K bytes, are given to the network
  64. card. This memory is then treated as if it were main memory. No
  65. special instructions in the CPU are needed to get data from the
  66. card since it is like taking data from one part of main memory to
  67. another.
  68.  
  69. With program I/O, the CPU is given a set of special instructions
  70. to handle the input/output functions. These instructions can be
  71. built into the chip or come with software. To send data, a
  72. request is sent from the network interface card to the CPU. The
  73. CPU then moves the data from the card over the bus to main
  74. memory.
  75.  
  76. Shared memory is the fastest method of moving data between the
  77. network interface card and the PC, but it not often used for
  78. expense and execution reasons. The advantage of DMA is that it
  79. removes work from the CPU, so it can perform other functions
  80. while data transfer is taking place. The disadvantage is the CPU
  81. cannot access memory while the DMA controller is working. I/O
  82. mapping doesn't remove work from the CPU and it also takes up
  83. memory, but it can be faster than DMA.
  84.  
  85. Different NICs use different types of NIC-PC communications.
  86. Yours will probably use DMA or program I/O. Experts disagree on
  87. which is better. If you really need to tell the difference,
  88. you'll have to experiment with your own applications.
  89.  
  90. Buffering. Most NICs use a buffer. The buffer is a storage place
  91. that holds data as it is moving into and out of the NIC. The
  92. purpose of the buffer is simple: to make up for inherent delays
  93. in transmission. To do this, a buffer temporarily holds data,
  94. either for transmission onto the network cable or for transfer
  95. into the PC. While in the buffer, data may be acted on,
  96. "packetized" or "depacketized," or it may simply sit while the
  97. NIC handles other things.
  98.  
  99. A buffer is needed because some parts of data transfer are slower
  100. than others. Data usually comes into the card faster than it can
  101. be converted from serial or parallel, depacketized, read and
  102. sent. This is true in both directions.
  103.  
  104. Some NICs do not have buffers. Instead they use PC RAM. This can
  105. be less expensive, but usually slower. It also takes up precious
  106. memory.
  107.  
  108. Packet formation. This is the most important job of the network
  109. and it is almost always done by the NIC. Packets are the units of
  110. transmission used on most LANs. Files and messages for
  111. transmission are broken up into packets as they are sent. At the
  112. other end the packets are put together to reform the original
  113. file or message.
  114.  
  115. A packet has three sections: header, data and trailer. The header
  116. includes an alert to signal "packet on the way," the packet's
  117. source address, destination address and clock information to
  118. synchronize transmission. In some networks, headers also have
  119. preambles used for various purposes, like setting up parameters
  120. for transmission. They can also have a control field to direct
  121. the packet through the network, a byte count and a message type
  122. field.
  123.  
  124. The data section is just that, the data being sent, for example,
  125. the numbers in a spreadsheet or words in a document. On some
  126. networks, the data section of a packet is as large as 12K bytes.
  127. On Ethernet, it is 4K bytes. Most networks fall between 1K and 4K
  128. bytes.
  129.  
  130. The trailer has an error checking part called a cyclical
  131. redundancy check (CRC). It is a number which is the result of a
  132. mathematical calculation done on the packet by the sending NIC.
  133. When the packet arrives at its destination, the same mathematical
  134. calculation is repeated. If the result is the same, no errors
  135. occurred in transmission -- all the ones and zeros were in the
  136. right place. If the numbers don't match, an error occurred and
  137. the packet is sent again. The trailer, like the header, can hold
  138. other information.
  139.  
  140. TRANSMISSION
  141. Parallel-serial conversion. Data comes from the PC in parallel
  142. form, eight bits at a time. It must travel over the cable in
  143. serial form, one bit at a time. And vice versa. Thus, the network
  144. interface card must perform the conversion between the two forms.
  145. Usually this is done by a controller on the card.
  146.  
  147. Encoding/decoding.
  148. Once a packet is formed and changed from parallel to serial, it
  149. is ready for sending over the line. To do this it must be
  150. encoded; it must be converted into a series of electrical pulses
  151. that convey information.
  152.  
  153. Most network interface cards use Manchester encoding. Serial data
  154. is divided into things called bit periods. Each of these periods
  155. (actual fractions of seconds) is divided in half. The two halves
  156. together represent a bit. From the first half to the second half
  157. of each bit period there is a change in the polarity of the
  158. signal, from positive to negative, or vice versa. There must be a
  159. change during each bit period because the change represents the
  160. data. A change from negative to positive represents a 1. A change
  161. from positive to negative represents a 0. Or vice versa depending
  162. on the network.
  163.  
  164. Of course, it is these 1's and 0's that represent data. That's
  165. how digital data is actually sent using electrical impulses.
  166.  
  167. Cable access. 
  168. Before data can be sent, however, the network interface card must
  169. have access to the cable. Not all cards can send at once. If they
  170. do, their transmissions will collide and be lost.
  171.  
  172. The various access methods used were discussed last month. Token
  173. Ring and Arcnet LANs use an electronic token to grant network
  174. access. Ethernet lets any workstation transmit at will and then
  175. look for collisions to see if it must transmit again. The entire
  176. protocol for the access method, all the circuitry and firmware
  177. (software written into hardware), resides on the network access
  178. card. This is its main job, getting data onto the cable in
  179. reliable form.
  180.  
  181. Handshaking. 
  182. After getting data from the PC, formatting it, encoding it and
  183. getting cable access, the network interface card has just one
  184. more task before it can send data: handshaking. In order to send
  185. data successfully, there must be a second NIC card waiting to
  186. receive it. To make sure, there is a short period of
  187. communication between two cards before data is sent. During this
  188. period, the parameters for the upcoming communication are decided
  189. upon through negotiation.
  190.  
  191. During negotiation, the transmitting card sends the parameters it
  192. wants to use. The receiving card answers with its parameters. The
  193. card with the slower, smaller, less complicated parameters always
  194. wins. That's because more sophisticated cards can "lower"
  195. themselves while less sophisticated cards can't "raise"
  196. themselves.
  197.  
  198. Negotiation sets the maximum packet size to be sent, how many
  199. packets before an answer, timer values, acknowledge time outs
  200. (how long to wait for an answer), buffer sizes, etc.
  201.  
  202. Transmission/reception. 
  203. Finally, everything is set. The only thing left is for the
  204. transceiver to put the data on the cable. The transceiver gives
  205. the data power to make it down the line. It actually puts the
  206. electrical signal out over the cable, making sure the data can
  207. get to the next card, the next repeater, amplifier or bridge.
  208.  
  209. At the other end, a transceiver is waiting to accept the signal
  210. and begin the whole process in reverse, from modulated signal
  211. through decoding, serial- parallel conversion and depacketizing
  212. to PC-readable data.
  213.  
  214. PICK A CARD
  215. Most people look only at performance when they choose a network
  216. interface card. Some will also consider the access method and
  217. topology used. This is fine when choosing the type of network
  218. interface card. Ethernet tends to be better for bursty networks.
  219. Its topology makes sense in scientific environments. Token Ring
  220. and Arcnet do better with constant traffic. Their topologies are
  221. better in offices. But there is more to choosing a network
  222. interface card than performance and access method.
  223.  
  224. The most important consideration in buying a network interface is
  225. reliability.  It doesn't matter how fast your network card is if
  226. it doesn't work, causes errors, loses packets, drops the line,
  227. etc. There is nothing more frustrating than having to isolate
  228. network hardware problems. Moreover, once found, replacing a
  229. network interface card means opening up a PC, setting dip
  230. switches and possibly reconfiguring software. Look for a network
  231. interface card that will work forever. This means talking to
  232. users and installers.
  233.  
  234. Other considerations when buying a network interface card center
  235. on your application. Figure out what kind of traffic your network
  236. will be sending. Different topologies, different access methods
  237. and different cabling schemes will guide your choice of network
  238. interface card. So will the network operating system you plan on
  239. using. But we'll get to that hairy subject in next month's
  240. column.
  241.  
  242. -- by Aaron Brenner
  243.  
  244.  
  245.  
  246.